import request from '@/utils/request';

// 查询广告列表
export function listAd(query) {
	return request({
		url: '/mall/ad/list',
		method: 'post',
		data: query,
	});
}

// 查询广告详细
export function getAd(id) {
	return request({
		url: '/mall/ad/getInfo',
		method: 'post',
		data: { id: id },
	});
}

// 新增广告
export function addAd(data) {
	return request({
		url: '/mall/ad/add',
		method: 'post',
		data: data,
	});
}

// 编辑广告
export function updateAd(data) {
	return request({
		url: '/mall/ad/edit',
		method: 'post',
		data: data,
	});
}

// 删除广告
export function delAd(id) {
	return request({
		url: '/mall/ad/remove',
		method: 'post',
		data: { id: id },
	});
}

// 导出广告
export function exportAd(query) {
	return request({
		url: '/mall/ad/export',
		method: 'post',
		params: query,
	});
}
